   package com.javalong.affairs.module.main.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.javalong.affairs.R;
import com.javalong.affairs.base.ui.ImageTip;

public class MainAdapter extends BaseAdapter {

	/*
	 * private int[] imgs = new int[] { R.drawable.a1, R.drawable.a2,
	 * R.drawable.a3, R.drawable.a4, R.drawable.a5, R.drawable.a6,
	 * R.drawable.a7, R.drawable.a8, R.drawable.a9 };
	 */
	private int[] imgs = new int[] { R.drawable.a1, R.drawable.a2,
			R.drawable.a3, R.drawable.a4, R.drawable.a5, R.drawable.a6 };
	/*
	 * private String[] tips = new String[] { "任务查询", "任务提交", "统计分析", "事件通知",
	 * "智能查询", "个人信息", "个人日程", "项目跟踪", "任务进展" };
	 */

	private String[] tips = new String[] { "事件通知", "个人日程", "智能查询", "任务跟踪",
			"个人信息", "项目跟踪" };

	private LayoutInflater inflater;

	public MainAdapter(Context context) {
		inflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		return imgs.length;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ImageTip imgTip = (ImageTip) inflater.inflate(R.layout.item_main, null);
		imgTip.setImage(imgs[position]);
		imgTip.setText(tips[position]);
		return imgTip;
	}

}
